if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_NhomKhachHang_Insert]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_NhomKhachHang_Insert]
GO
CREATE PROC [sp_NhomKhachHang_Insert]
	@Ten					nvarchar(50),
	@ChietKhau				float,
	@GhiChu					nvarchar(100),
	@MaLoaiKhachHang			int

AS
BEGIN
	DECLARE @Ngay_cap_nhat_cuoi datetime
	SET @Ngay_cap_nhat_cuoi = getdate()
	INSERT INTO NhomKhachHang(
					Ten,
					ma_loai_khach_hang,
					Chiet_khau,
					Ghi_chu,
					Ngay_cap_nhat_cuoi
				)
	VALUES(				
		@Ten,
		@MaLoaiKhachHang,
		@ChietKhau,
		@GhiChu,
		@Ngay_cap_nhat_cuoi
	)
END
